<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@include file="header.jsp"%>
	<div class="container">
		<div class="stage">
			<h2 class="stage-heading">输入书籍名称</h2>
			<form id="search" >
			<input class="form-control" type="text" name="bookname"/>
			<p></p>
			<button id="search-btn" data-src="book-search-action.jsp" class="btn btn-lg btn-primary btn-block" type="submit">查找</button>
			</form>
			<script type="text/javascript">
				$(function() {
					$("#search").submit(function(event) {
						event.preventDefault();
						var url = $("#search-btn").attr("data-src");
						$.ajax({
							url:url,
							async:false,
							type:'post',
							data:$(this).serialize(),
							dataType:'html',
							context:$(".panel"),
							success:function(data) {
								$(this).html(data);
								$(this).show();
							}
						});
					}
				);
				});
			</script>
		</div>
		<div class="panel panel-default" style="display:none;"></div>
	</div>
</body>
</html>